<?php include("header_liga_required.php"); ?>

<table height="100%" cellSpacing="0" cellPadding="0" width="100%"
	border="0" bgcolor="#FFFFFF">

	<tr>
		<td id="leftFiller" valign="top" height="100%" rowspan="3"
			bgcolor="#666666">
		<table border="0" cellpadding="0" cellspacing="0" height="100%"
			width="8px">
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>
		</td>
		<td id="header" valign="top" width="100%">
		<table border="0" width="100%" cellpadding="3" cellspacing="0" bgcolor="#10425b">
                <tr>
                    <td bgcolor="#666666" width="40%">
                        <?php include("inc_title.html"); ?>
                    </td>
                    <td bgcolor="#666666" align="right" valign="top">&nbsp;
                          <span class="headerSmall">Huidige versie PLAYER.DBF: <?=CURRENT_PLAYER_DBF?>
                        <?php
                        if (isset($user) && $user->club_id == 100) {
                        ?>
                        <br/>
                        <a class="headerSmall" href="import_player.php">laad andere versie</a>
                        <?php
                        }
                        ?>
                        </span>
                    </td>
                </tr>
            </table>
            <table align="center" border="0" width="100%" height="90%" cellpadding="0" cellspacing="0" style="border-top:#BCDD10 4px solid;">
                <tr>
                    <?php include("inc_sublinks.php"); ?> 
                </tr>
			<tr>
				<td colspan="2" nowrap bgcolor="#BCDD10" height="4"><img
					src="../../assets/images/spacer.gif" alt="" height="1" width="1"></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td valign="top">
				<table align="left" cellspacing="10" width="100%">
					<tr>
						<td><span class="blackHeaderLarge">Zilveren Toren <?=CURRENT_ZT_YEAR?>
						- Wish list</span>
						<br/>Hieronder vindt u het overzicht van alle wensen van de clubs.
						</td>
					</tr>
					<tr>
						<td>
						<table width="90%" align="center" cellspacing="0" cellpadding="3"
							class="yellowBox">
							<tr>
								<td width="30%" align="center" valign="top"><strong>Club</strong></td>
								<td align="center" valign="top"><strong>Wensen</strong></td>
							</tr>
							<?php
							mysql_connect(DB_SERVER, DB_USER, DB_PWD);
	                        mysql_select_db(DB_CATALOG);
	                        
	                        $query = "select c.club_id, c.clubname, s.wishes 
	                        from zt_subscription s join club c
	                        on c.club_id = s.club_id join zt_tournament t
	                        on t.tournament_id = s.tournament_id
	                        where t.isCurrent = 1 order by c.club_id";
	                        $result = mysql_query($query);
	                        $wishes = array();
	                        while ($row = mysql_fetch_assoc($result)) {
	                            $subscription = new ZTSubscription;
	                            $subscription->clubId = $row['club_id'];
	                            $subscription->clubName = $row['clubname'];
	                            $subscription->wishes = $row['wishes'];
	                            array_push($wishes, $subscription);
	                        }
	                        
	                        foreach ($wishes as $wish) {
	                        	if (empty($wish->wishes)) {
	                        		$wish->wishes = "&nbsp;";
	                        	}
	                        ?>
	                        <tr>
	                        	<td valign="top" style="border-bottom:1px solid #A6C218;"><?=$wish->clubName?></td>
                                <td valign="top" style="border-bottom:1px solid #A6C218;"><?=$wish->wishes?></td>
                            </tr>
	                        <?php
	                        }
							?>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>


<?php include("footer.php"); ?>